VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "ClsVentaAutomatica"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit

'Clase de venta_automatica
Public WithEvents orset As ClsRecordset
Attribute orset.VB_VarHelpID = -1

Public Event DataChanged()

Public codigo As String
Public codGeneracionVau As String
Public codCliente As String
Public facturado As Boolean
Public nro_nota As Integer

'Constructor y Destructor
Private Sub Class_Initialize()
    Set orset = New ClsRecordset
    orset.setCampos dbCampos(vau)
    orset.setTablas Array(vau)
End Sub
Private Sub Class_Terminate()
    Set orset = Nothing
End Sub

Public Sub consulta()
    orset.consulta
End Sub
Public Sub agregaVenta(VentaCodig As String)
    orset.sInsertGral Array(tva_vau_id, tva_tra_id), _
                      Array(Me.codigo, VentaCodig), _
                      Array(tva), False, False
End Sub

Public Sub Nuevo(newgvaCodigo As String, newclienteCodigo As String, newfacturado As String, nro_nota As String)
    orset.sInsert Array("", newgvaCodigo, newclienteCodigo, newfacturado, nro_nota)
End Sub
Public Sub Modificar(codig As String, newgvaCodigo As String, newclienteCodigo As String, newfacturado As String, nro_nota As String)
    orset.sUpdate Array(codig, newgvaCodigo, newclienteCodigo, newfacturado, nro_nota)
End Sub
Public Sub Borrar(codig As String)
    orset.sDelete Array(vau_id & "=" & codig)
End Sub
Private Sub Reload_members()
    With orset
        codigo = .getDato(vau_id)
        codGeneracionVau = .getDato(vau_gva_id)
        codCliente = .getDato(vau_cli_id)
        facturado = .getDato(vau_facturado)
        nro_nota = .getDato(vau_nro_nota)
    End With
    RaiseEvent DataChanged
End Sub
Private Sub orset_DataChanged()
    Reload_members
End Sub
